package cn.hebutrun.oulabot.service.impl;

import cn.hebutrun.oulabot.common.Constants;
import cn.hebutrun.oulabot.service.ITryService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Random;

/**
 * @author zhaolong
 * @since 2022-09-06
 */
@Service
public class TryServiceImpl implements ITryService {

  @Override
  @Cacheable(value = Constants.REDIS_CACHE_NAME, key = "#ip")
  public String lunch(String ip) {
    List<String> list = List.of("四菜一汤", "馅饼", "自选快餐", "麻辣烫", "苏氏牛肉面", "刀削面", "吉野家");
    return list.get(new Random().nextInt(list.size()));
  }
}
